package com.itheima.d2_SingleInstance_2;

public class test {
    public static void main(String[] args) {
        SingleInstance s1 = SingleInstance.getInstance();
        SingleInstance s2 = SingleInstance.getInstance();
        SingleInstance s3 = SingleInstance.getInstance();
        System.out.println(s1);
        System.out.println(s2);
        System.out.println(s3);
        System.out.println(s1==s2);
    }
}
/**
 * 运行结果：
 *          com.itheima.d2_SingleInstance_2.SingleInstance@4eec7777
 *          com.itheima.d2_SingleInstance_2.SingleInstance@4eec7777
 *          com.itheima.d2_SingleInstance_2.SingleInstance@4eec7777
 *          true
 * 可以看出实际操作效果和饿汉单例类似，区别在于需要主动去创建一个单例对象
 */